<template>
	<view class="content">
		<view class="content-search">
			<img class="content-search-img" src="/static/img/index/search.png">
			<view class="uni-form-item uni-column content-search-input">
				<input class="uni-input" confirm-type="search" placeholder="搜索" @focus="gotoSearch"/>
			</view>
			<view @click="customerService" class="content-search-kefu"><img src="/static/img/index/kefu.png">
				<text>客服</text>
			</view>
		</view>
		
		<view class="uni-padding-wrap">
			<view class="page-section swiper">
				<view class="page-section-spacing">
					<swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration">
						<swiper-item v-for="(item,index) in banner" :key="index">
							<view class="swiper-item"><img :src="demoUrl + item.image" mode="widthFix"></view>
						</swiper-item>
					</swiper>
				</view>
			</view>
		</view>
		<view class="line"></view>
		<!-- 优惠券 -->
		<view class="content-coupon" v-if="couponList" v-for="lm in couponList" :key="lm.type">
			<view class="content-coupon-r2" v-if="lm.type==6">
				<a href="lm.imageList[0].url" @click="gotoCoupon(lm.id)"><img :src="demoUrl + lm.imageList[0].image" mode="widthFix"></a>
				<a href="lm.imageList[1].url" @click="gotoCoupon(lm.id)"><img :src="demoUrl + lm.imageList[1].image" mode="widthFix"></a>
				<a href="lm.imageList[2].url" @click="gotoCoupon(lm.id)"><img :src="demoUrl + lm.imageList[2].image" mode="widthFix"></a>
				<a href="lm.imageList[3].url" @click="gotoCoupon(lm.id)"><img :src="demoUrl + lm.imageList[3].image" mode="widthFix"></a>
			</view>
			<view class="line" v-if="lm.type==6 && lm.segregationLineFlag"></view>
			<view class="content-coupon-r2" v-if="lm.type==3">
				<a href="javascript:void(0);" @click="gotoCoupon(lm.id)"><img :src="demoUrl +lm.imageList[0].image" mode="widthFix"></a>
				<a href="javascript:void(0);" @click="gotoCoupon(lm.id)"><img :src="demoUrl +lm.imageList[1].image" mode="widthFix"></a>
			</view>
			<view class="line" v-if="lm.type==3 && lm.segregationLineFlag"></view>
		</view>
		<!-- 自定义 -->
	    <view class="content-custom" v-if="list4[0].goodsList">
			<view  v-if="list4[0].image" >
				<img :src="demoUrl + list4[0].image" style="width:100%" mode="widthFix">
			</view>
			<scroll-view scroll-x="true" class="content-custom-content">
			   <block v-for="(item, index) in list4[0].goodsList" :key="index">
				 <view class="content-custom-content-item" @click="goDetail(item.goodsId)">
				   <view class="img">
					 <img :src="demoUrl + item.imageUrl" mode="widthFix">
				   </view>
				   <view class="content-custom-content-text">
					   <view class="content-custom-content-item-title">{{item.goodsName}}</view>
					   <view><text style="color: red;">￥{{item.salesPrice}}</text><img style="float: right;width: 40%;padding:10upx 5upx 0 0;" mode="widthFix" src="/static/img/index/vip.png"></view>
					   <view style="text-decoration:line-through;line-height: 1.3;color:#ABABAB">￥{{item.originalPrice}}</view>
				   </view>
				 </view>
			   </block>
			</scroll-view>
		</view>
		<view class="content-custom">
			<view v-for="(item,index) in list5" :key="index">
				<view class="line"></view>
				<view>
					<img :src="demoUrl +item.image" style="width:100%" mode="widthFix">
				</view>
				<view>
					<view v-for="(item1,index2) in item.goodsList" :key="index2">
						<view class="content-custom-content-item" @click="goDetail(item1.goodsId)" style="width:48.9%;float: left;margin: 5upx;overflow: auto;box-sizing: border-box;">
						  <view class="img">
							 <img :src="demoUrl + item1.imageUrl" mode="widthFix">
						  </view>
						  <view class="content-custom-content-text">
							   <view class="content-custom-content-item-title">{{item1.goodsName}}</view>
							   <view><text style="color: red;font-size: 34upx;">￥{{item1.salesPrice}}</text><img style="float: right;width: 28%;padding:8upx 10upx 0 0;" mode="widthFix" src="/static/img/index/vip.png"></view>
							   <view style="text-decoration:line-through;line-height: 1.3;color:#ABABAB;font-size: 26upx;">￥{{item1.originalPrice}}</view>
						  </view>
						</view>
					</view>
				</view>
			</view>
			
		</view>
		<view class="line"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				demoUrl:'',
				loading:false,
				indicatorDots: true,
				autoplay: true,
				interval: 2000,
				duration: 500,
				listData:[],
				banner:[],
				couponList:[],
				list4:[],
				list5:[],
			}
		},
		onLoad() {
			// uni.setStorageSync('userId',17583)
			// this.getIndexData();
			let userId = wx.getStorageSync('userId');
			if (userId) { this.getcartList()}
		},
		mounted() {
			let aa = "{\"data\":{\"code\":1,\"msg\":\"操作成功\",\"data\":[{\"id\":1,\"name\":\"banner\",\"sort\":1,\"remark\":\"默认栏目\",\"isTitle\":1,\"indexInfoColumnList\":[],\"image\":\"http://web.sltonline.cn/title/uploadImg/201908/project_main_3f7febe4965441639152a8941ce5492d.png\",\"infos\":[{\"infoId\":140,\"name\":\"423\",\"url\":\"https://www.hao123.com/?tn=95623186_hao_pg\",\"image\":\"uploadImg/201910/project_main_21475143871b4aac83f81cfc4c94abf9.png\",\"sort\":234,\"remark\":null,\"categoryId\":1,\"startTime\":null,\"endTime\":null,\"shoppingRushId\":null,\"rushStock\":null,\"goodsList\":null},{\"infoId\":171,\"name\":\"1\",\"url\":\"2\",\"image\":\"uploadImg/201910/project_main_8dcf972f3252486693ce232c13f43ef2.png\",\"sort\":2,\"remark\":null,\"categoryId\":1,\"startTime\":null,\"endTime\":null,\"shoppingRushId\":null,\"rushStock\":null,\"goodsList\":null}]},{\"id\":2,\"name\":\"类目图标\",\"sort\":2,\"remark\":\"默认栏目\",\"isTitle\":1,\"indexInfoColumnList\":[],\"image\":\"http://web.sltonline.cn/title/uploadImg/201908/project_main_3f7febe4965441639152a8941ce5492d.png\",\"infos\":[{\"infoId\":115,\"name\":\"限时秒杀\",\"url\":\"http://web.sltonline.cn/title/information.html?infoId=31\",\"image\":\"uploadImg/201910/project_main_51eac7ab3e994f4d84ceef2fefaa356c.png\",\"sort\":12312,\"remark\":null,\"categoryId\":2,\"startTime\":null,\"endTime\":null,\"shoppingRushId\":null,\"rushStock\":null,\"goodsList\":null},{\"infoId\":172,\"name\":\"低价拼团\",\"url\":\"\",\"image\":\"uploadImg/201910/project_main_28bd0370d3d34bf8b81607001424522d.png\",\"sort\":66,\"remark\":null,\"categoryId\":2,\"startTime\":null,\"endTime\":null,\"shoppingRushId\":null,\"rushStock\":null,\"goodsList\":null},{\"infoId\":125,\"name\":\"每日签到\",\"url\":\"http://web.sltonline.cn/title/index.html#/rushDetails160\",\"image\":\"uploadImg/201910/project_main_bf6ad66fdfde44189fbfe3af52821a3a.png\",\"sort\":4,\"remark\":null,\"categoryId\":2,\"startTime\":null,\"endTime\":null,\"shoppingRushId\":null,\"rushStock\":null,\"goodsList\":null},{\"infoId\":134,\"name\":\"下单抽奖\",\"url\":\"http://mall.sltonline.cn/title/Sign.html\",\"image\":\"uploadImg/201910/project_main_81edd9679a6f4122be3f8ae85c5caef5.png\",\"sort\":3,\"remark\":null,\"categoryId\":2,\"startTime\":null,\"endTime\":null,\"shoppingRushId\":null,\"rushStock\":null,\"goodsList\":null}]},{\"id\":5,\"name\":\"抢购模块\",\"sort\":3,\"remark\":\"自定义\",\"isTitle\":0,\"indexInfoColumnList\":[],\"image\":\"http://web.sltonline.cn/title/uploadImg/201910/project_main_adf9cacbd1e94d6ca987c677e427c1eb.png\",\"infos\":[{\"infoId\":178,\"name\":\"2019夏季超值福袋只要66（T）\",\"url\":null,\"image\":\"uploadImg/201910/project_main_eaa92e49249046258938ae3fa9b833a0.jpg\",\"sort\":55,\"remark\":null,\"categoryId\":5,\"startTime\":1571297640000,\"endTime\":1573284840000,\"shoppingRushId\":166,\"rushStock\":100,\"goodsList\":null},{\"infoId\":177,\"name\":\"2019夏季超值福袋只要33（T）\",\"url\":null,\"image\":\"uploadImg/201910/project_main_f70004996dd6415ea3062a73f1f6a5c7.jpg\",\"sort\":54,\"remark\":null,\"categoryId\":5,\"startTime\":1572489600000,\"endTime\":1572490800000,\"shoppingRushId\":165,\"rushStock\":100,\"goodsList\":null},{\"infoId\":176,\"name\":\"2019夏季超值福袋只要99.9（T）\",\"url\":null,\"image\":\"uploadImg/201910/project_main_3f247ee15eda47b9b0f4175a22a7058b.jpg\",\"sort\":12,\"remark\":null,\"categoryId\":5,\"startTime\":1572490800000,\"endTime\":1571457600000,\"shoppingRushId\":164,\"rushStock\":100,\"goodsList\":null},{\"infoId\":180,\"name\":\"测试001\",\"url\":null,\"image\":\"uploadImg/201910/project_main_74194b0c6365466f98a650f92422e6d4.png\",\"sort\":11,\"remark\":null,\"categoryId\":5,\"startTime\":1560831180000,\"endTime\":1593145200000,\"shoppingRushId\":160,\"rushStock\":100,\"goodsList\":null},{\"infoId\":179,\"name\":\"测试003\",\"url\":null,\"image\":\"uploadImg/201910/project_main_f744dd6fc4e5401ba178b0c5086de038.png\",\"sort\":1,\"remark\":null,\"categoryId\":5,\"startTime\":1560831360000,\"endTime\":1560918000000,\"shoppingRushId\":162,\"rushStock\":200,\"goodsList\":null}]},{\"id\":3,\"name\":\"推荐栏目\",\"sort\":4,\"remark\":\"默认栏目\",\"isTitle\":1,\"indexInfoColumnList\":[{\"id\":27,\"name\":\"03\",\"images\":\"[{\\\"url\\\":\\\"http://web.sltonline.cn/title/couponProject.html?couponTopicId=15\\\",\\\"image\\\":\\\"uploadImg/201901/project_main_43a33b17584343deb68d6cd6f51b072c.jpg\\\"},{\\\"url\\\":\\\"http://web.sltonline.cn/title/couponProject.html?couponTopicId=16\\\",\\\"image\\\":\\\"uploadImg/201901/project_main_7cf932fcf06e45f2a3a05abd864c2f08.jpg\\\"}]\",\"sort\":2,\"createTime\":1526953498000,\"deleteFlag\":false,\"enableFlag\":true,\"segregationLineFlag\":true,\"type\":3,\"categoryId\":3,\"product\":null,\"orderBy\":null,\"imageList\":[{\"image\":\"uploadImg/201901/project_main_43a33b17584343deb68d6cd6f51b072c.jpg\",\"url\":\"http://web.sltonline.cn/title/couponProject.html?couponTopicId=15\"},{\"image\":\"uploadImg/201901/project_main_7cf932fcf06e45f2a3a05abd864c2f08.jpg\",\"url\":\"http://web.sltonline.cn/title/couponProject.html?couponTopicId=16\"}],\"goodsBeanList\":null},{\"id\":28,\"name\":\"04\",\"images\":\"[{\\\"url\\\":\\\"\\\",\\\"image\\\":\\\"uploadImg/201910/project_main_49a24f9844a445ab8c846b6a73bcb852.jpg\\\"},{\\\"url\\\":\\\"uuuu\\\",\\\"image\\\":\\\"uploadImg/201910/project_main_b1fdbdc0362b46b1a47abe9c9c9c0a32.jpg\\\"},{\\\"url\\\":\\\"\\\",\\\"image\\\":\\\"uploadImg/201910/project_main_f5e1960f02b64e38b37b7cfe0fc82a96.jpg\\\"}]\",\"sort\":3,\"createTime\":1526953617000,\"deleteFlag\":false,\"enableFlag\":true,\"segregationLineFlag\":true,\"type\":4,\"categoryId\":3,\"product\":null,\"orderBy\":null,\"imageList\":[{\"image\":\"uploadImg/201910/project_main_49a24f9844a445ab8c846b6a73bcb852.jpg\",\"url\":\"\"},{\"image\":\"uploadImg/201910/project_main_b1fdbdc0362b46b1a47abe9c9c9c0a32.jpg\",\"url\":\"uuuu\"},{\"image\":\"uploadImg/201910/project_main_f5e1960f02b64e38b37b7cfe0fc82a96.jpg\",\"url\":\"\"}],\"goodsBeanList\":null}],\"image\":\"http://web.sltonline.cn/title/uploadImg/201908/project_main_3f7febe4965441639152a8941ce5492d.png\",\"infos\":[]},{\"id\":4,\"name\":\"自定义栏目\",\"sort\":5,\"remark\":\"自定义\",\"isTitle\":1,\"indexInfoColumnList\":[],\"image\":\"http://web.sltonline.cn/title/uploadImg/201908/project_main_3f7febe4965441639152a8941ce5492d.png\",\"infos\":[{\"infoId\":86,\"name\":\"自定义栏目1\",\"url\":\"http://m.sltonline.cn/title/goods.html?goodsId=111\",\"image\":\"uploadImg/201910/project_main_a7602932be53469eb39b85e084e0bb10.png\",\"sort\":601,\"remark\":\"\",\"categoryId\":4,\"startTime\":null,\"endTime\":null,\"shoppingRushId\":null,\"rushStock\":null,\"goodsList\":[{\"goodsId\":231,\"typeId\":9,\"goodsName\":\"199美丽顾问礼包\",\"originalPrice\":199,\"salesPrice\":0.01,\"salesCount\":149,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201910/project_main_2a4b7f66e8804a63831ed5e105262183.jpg\",\"goodsOrCards\":0,\"status\":2,\"stock\":999999860,\"limitBuy\":0,\"outone\":null,\"outtwo\":null,\"isDistri\":0,\"isSetup\":0},{\"goodsId\":233,\"typeId\":4,\"goodsName\":\"臻美抗初老\",\"originalPrice\":100,\"salesPrice\":29,\"salesCount\":35,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201909/project_main_19bae5fe6ebc455faa81f27e813a78bf.png\",\"goodsOrCards\":0,\"status\":2,\"stock\":6,\"limitBuy\":1,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":0},{\"goodsId\":229,\"typeId\":7,\"goodsName\":\"【套装】诗丽堂 小白+小黑+眼部精华素+玻尿酸补水面膜10片（测试）\",\"originalPrice\":500,\"salesPrice\":99,\"salesCount\":64,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201908/project_main_79ae9e124d654ded95231d1792713190.jpg\",\"goodsOrCards\":0,\"status\":2,\"stock\":391,\"limitBuy\":0,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":0},{\"goodsId\":228,\"typeId\":4,\"goodsName\":\"【仙人掌水乳套组】仙人掌多肽活润保湿水+活润保湿乳\",\"originalPrice\":800,\"salesPrice\":199,\"salesCount\":201,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201908/project_main_8106849d1e244baf9768abd1ed1b0fdb.jpg\",\"goodsOrCards\":0,\"status\":2,\"stock\":309,\"limitBuy\":0,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":0},{\"goodsId\":227,\"typeId\":4,\"goodsName\":\"玻尿酸+深海鱼籽面膜\",\"originalPrice\":500,\"salesPrice\":1,\"salesCount\":40,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201907/project_main_50dc24f057994dd48d185c0a3a186423.jpg\",\"goodsOrCards\":0,\"status\":9,\"stock\":180,\"limitBuy\":0,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":0},{\"goodsId\":220,\"typeId\":33,\"goodsName\":\"植物洗面奶\",\"originalPrice\":100,\"salesPrice\":10,\"salesCount\":4,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201903/project_main_b5aa6957d6e8440a9bcc01f5c5684c5c.png\",\"goodsOrCards\":0,\"status\":2,\"stock\":96,\"limitBuy\":0,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":0},{\"goodsId\":222,\"typeId\":45,\"goodsName\":\"真萃六件套\",\"originalPrice\":168,\"salesPrice\":0.01,\"salesCount\":53,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201910/project_main_2a6c1a4bc5a3497eae7a11f853ab3082.png\",\"goodsOrCards\":0,\"status\":2,\"stock\":89,\"limitBuy\":0,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":1}]},{\"infoId\":15,\"name\":\"潮流彩妆\",\"url\":\"http://m.sltonline.cn/title/index.html#/goodsList6\",\"image\":\"uploadImg/201910/project_main_80320c64340c438a9439c84d84163d6e.png\",\"sort\":40,\"remark\":\"分割线\",\"categoryId\":4,\"startTime\":null,\"endTime\":null,\"shoppingRushId\":null,\"rushStock\":null,\"goodsList\":[{\"goodsId\":228,\"typeId\":4,\"goodsName\":\"【仙人掌水乳套组】仙人掌多肽活润保湿水+活润保湿乳\",\"originalPrice\":800,\"salesPrice\":199,\"salesCount\":201,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201908/project_main_8106849d1e244baf9768abd1ed1b0fdb.jpg\",\"goodsOrCards\":0,\"status\":2,\"stock\":309,\"limitBuy\":0,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":0},{\"goodsId\":233,\"typeId\":4,\"goodsName\":\"臻美抗初老\",\"originalPrice\":100,\"salesPrice\":29,\"salesCount\":35,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201909/project_main_19bae5fe6ebc455faa81f27e813a78bf.png\",\"goodsOrCards\":0,\"status\":2,\"stock\":6,\"limitBuy\":1,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":0},{\"goodsId\":231,\"typeId\":9,\"goodsName\":\"199美丽顾问礼包\",\"originalPrice\":199,\"salesPrice\":0.01,\"salesCount\":149,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201910/project_main_2a4b7f66e8804a63831ed5e105262183.jpg\",\"goodsOrCards\":0,\"status\":2,\"stock\":999999860,\"limitBuy\":0,\"outone\":null,\"outtwo\":null,\"isDistri\":0,\"isSetup\":0},{\"goodsId\":229,\"typeId\":7,\"goodsName\":\"【套装】诗丽堂 小白+小黑+眼部精华素+玻尿酸补水面膜10片（测试）\",\"originalPrice\":500,\"salesPrice\":99,\"salesCount\":64,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201908/project_main_79ae9e124d654ded95231d1792713190.jpg\",\"goodsOrCards\":0,\"status\":2,\"stock\":391,\"limitBuy\":0,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":0},{\"goodsId\":227,\"typeId\":4,\"goodsName\":\"玻尿酸+深海鱼籽面膜\",\"originalPrice\":500,\"salesPrice\":1,\"salesCount\":40,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201907/project_main_50dc24f057994dd48d185c0a3a186423.jpg\",\"goodsOrCards\":0,\"status\":9,\"stock\":180,\"limitBuy\":0,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":0},{\"goodsId\":220,\"typeId\":33,\"goodsName\":\"植物洗面奶\",\"originalPrice\":100,\"salesPrice\":10,\"salesCount\":4,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201903/project_main_b5aa6957d6e8440a9bcc01f5c5684c5c.png\",\"goodsOrCards\":0,\"status\":2,\"stock\":96,\"limitBuy\":0,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":0},{\"goodsId\":222,\"typeId\":45,\"goodsName\":\"真萃六件套\",\"originalPrice\":168,\"salesPrice\":0.01,\"salesCount\":53,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201910/project_main_2a6c1a4bc5a3497eae7a11f853ab3082.png\",\"goodsOrCards\":0,\"status\":2,\"stock\":89,\"limitBuy\":0,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":1},{\"goodsId\":224,\"typeId\":45,\"goodsName\":\"真萃洁面泡沫+卸妆水\",\"originalPrice\":168,\"salesPrice\":1,\"salesCount\":11,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201910/project_main_890282f287914b2db8c67b3b5d4ba23c.jpg\",\"goodsOrCards\":0,\"status\":2,\"stock\":91,\"limitBuy\":0,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":0}]},{\"infoId\":181,\"name\":\"大牌专区\",\"url\":\"\",\"image\":\"uploadImg/201910/project_main_63a9917402724894940a69d03c950142.png\",\"sort\":1,\"remark\":null,\"categoryId\":4,\"startTime\":null,\"endTime\":null,\"shoppingRushId\":null,\"rushStock\":null,\"goodsList\":[{\"goodsId\":233,\"typeId\":4,\"goodsName\":\"臻美抗初老\",\"originalPrice\":100,\"salesPrice\":29,\"salesCount\":35,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201909/project_main_19bae5fe6ebc455faa81f27e813a78bf.png\",\"goodsOrCards\":0,\"status\":2,\"stock\":6,\"limitBuy\":1,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":0},{\"goodsId\":231,\"typeId\":9,\"goodsName\":\"199美丽顾问礼包\",\"originalPrice\":199,\"salesPrice\":0.01,\"salesCount\":149,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201910/project_main_2a4b7f66e8804a63831ed5e105262183.jpg\",\"goodsOrCards\":0,\"status\":2,\"stock\":999999860,\"limitBuy\":0,\"outone\":null,\"outtwo\":null,\"isDistri\":0,\"isSetup\":0},{\"goodsId\":229,\"typeId\":7,\"goodsName\":\"【套装】诗丽堂 小白+小黑+眼部精华素+玻尿酸补水面膜10片（测试）\",\"originalPrice\":500,\"salesPrice\":99,\"salesCount\":64,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201908/project_main_79ae9e124d654ded95231d1792713190.jpg\",\"goodsOrCards\":0,\"status\":2,\"stock\":391,\"limitBuy\":0,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":0},{\"goodsId\":228,\"typeId\":4,\"goodsName\":\"【仙人掌水乳套组】仙人掌多肽活润保湿水+活润保湿乳\",\"originalPrice\":800,\"salesPrice\":199,\"salesCount\":201,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201908/project_main_8106849d1e244baf9768abd1ed1b0fdb.jpg\",\"goodsOrCards\":0,\"status\":2,\"stock\":309,\"limitBuy\":0,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":0},{\"goodsId\":227,\"typeId\":4,\"goodsName\":\"玻尿酸+深海鱼籽面膜\",\"originalPrice\":500,\"salesPrice\":1,\"salesCount\":40,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201907/project_main_50dc24f057994dd48d185c0a3a186423.jpg\",\"goodsOrCards\":0,\"status\":9,\"stock\":180,\"limitBuy\":0,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":0},{\"goodsId\":220,\"typeId\":33,\"goodsName\":\"植物洗面奶\",\"originalPrice\":100,\"salesPrice\":10,\"salesCount\":4,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201903/project_main_b5aa6957d6e8440a9bcc01f5c5684c5c.png\",\"goodsOrCards\":0,\"status\":2,\"stock\":96,\"limitBuy\":0,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":0},{\"goodsId\":222,\"typeId\":45,\"goodsName\":\"真萃六件套\",\"originalPrice\":168,\"salesPrice\":0.01,\"salesCount\":53,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201910/project_main_2a6c1a4bc5a3497eae7a11f853ab3082.png\",\"goodsOrCards\":0,\"status\":2,\"stock\":89,\"limitBuy\":0,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":1},{\"goodsId\":224,\"typeId\":45,\"goodsName\":\"真萃洁面泡沫+卸妆水\",\"originalPrice\":168,\"salesPrice\":1,\"salesCount\":11,\"freeMailing\":1,\"imageUrl\":\"uploadImg/201910/project_main_890282f287914b2db8c67b3b5d4ba23c.jpg\",\"goodsOrCards\":0,\"status\":2,\"stock\":91,\"limitBuy\":0,\"outone\":0.2,\"outtwo\":0.1,\"isDistri\":1,\"isSetup\":0}]}]}]},\"header\":{\"Access-Control-Allow-Origin\":\"*\",\"Access-Control-Allow-Headers\":\"Authorization, token, sign, Authentication, X-Requested-With, origin, content-type, accept\",\"Content-Type\":\"application/json;charset=UTF-8\",\"Transfer-Encoding\":\"chunked\",\"Date\":\"Tue, 12 Nov 2019 08:38:15 GMT\"},\"statusCode\":200,\"cookies\":[],\"errMsg\":\"request:ok\",\"config\":{\"baseUrl\":\"http://192.168.1.22:8080/silk_wechat/\",\"header\":{\"token\":\"\",\"sign\":\"\",\"content-type\":\"application/json\"},\"data\":{},\"method\":\"GET\",\"dataType\":\"json\",\"responseType\":\"text\",\"url\":\"http://192.168.1.22:8080/silk_wechat/wechat/index/small\",\"requestId\":1573547858797}}";
		},
		onShareAppMessage (){
			
		},
		methods: {
			goDetail(id) {
				uni.reLaunch({
				    url: '/pages/goods/goodsDetail?id=' + id
				});
			},
			getIndexData: function() {
				let that = this;
				this.$api.index().then((res)=>{
					console.log('request success', res)
					if(res.data.code === 1){
						that.listData = res.data.data;
						that.listData.forEach(function(item,index){
							if(item.id === 1){
								that.banner = item.infos;
							}
							if(item.id === 3){
								that.couponList = item.indexInfoColumnList;
							}
							if(item.id === 4){
								that.list4 = JSON.parse(JSON.stringify(item.infos));
								item.infos.shift(item.infos);
								that.list5 = item.infos;
								console.log(that.list5)
							}
						})
					}
					
				}).catch((err)=>{
					console.log('request fail', err);
				})
			},
			customerService(){
				uni.showToast({  
				    title: "请联系客服",  
				    icon: 'none'
				})
			},
			getcartList () {
			    let that = this;
				this.$api.getcartList({"userId": wx.getStorageSync('userId')}).then((res)=>{
					if(res.data.code === 1){
						if (res.data.data.length === 0) {
							uni.removeTabBarBadge({
								index: 2,
							})
						} else if(res.data.data.length > 0) {
							let num = 0
							res.data.data.forEach(function(item,index){
								num += item.goodsSkuNum;
							})
							uni.setTabBarBadge({
								index: 2,
								text: num + ''
							})
						};
					}
					
				}).catch((err)=>{
					uni.hideLoading()
					console.log('request fail', err);
				})
			},
			//领取优惠券
			gotoCoupon(id){
				console.log(id)
			},
			gotoSearch(){
				uni.navigateTo({
				    url: '/pages/search/search'
				});
			}
		}
	}
</script>

<style scoped>
	@import '../../common/uni.css';
	.content {
		padding: 0;
	}
	.content-search{
		background-color: #fff;
		display: flex;
		position: relative;
		padding: 20upx 30upx;
		box-sizing: border-box;
		margin-bottom: 2upx;
	}
	.content-search-img{
		flex: 1;
		position: absolute;
		top: 30%;
		left: 50upx;
		width: 40upx;
		height: 40upx;
	}
	.content-search-input{
		flex: 10;
		background-color: #F4F4F4;
		border-radius: 50upx;
		overflow: hidden;
		padding: 0 0 0 50upx;
		box-sizing: border-box;
	}
	.content-search-input .uni-input{
		background-color: #F4F4F4;	
	}
	.content-search-kefu{
		flex: 1;
		box-sizing: border-box;
		padding-right:0upx;
		padding-left: 5upx;
		line-height: 1;
	}
	.content-search-kefu img{
		width: 45upx;
		height: 45upx;
	}
	.uni-padding-wrap{
		padding: 0;
		width: 100%;
		
	}
	.swiper-item{
		min-height: 420upx;
		max-height: 800upx;
		height: 100%;
		width: 100%;
	}
	.swiper-item img{
		width: 100%;
		height: 100%;
	}
	.content-coupon{
		background: #fff;
	}
	.content-coupon-r2{
		overflow: auto;
		padding: 0 5upx;
		box-sizing: border-box;
		
	}
	.content-coupon-r2 a{
		width: 48.9%;
		box-sizing: border-box;
		float: left;
		margin: 5upx;
	}
	.content-coupon-r2 a img{
		width: 100%;
	}
	.content-custom{
		background-color: #fff;
		overflow: auto;
	}
	.content-custom-content {
	  white-space: nowrap; // 滚动必须加的属性
	  width: 100%;
	  height: 100%;
	  padding: 0 20upx 20upx 20upx;
	  box-sizing: border-box;
	  margin: 0 auto;
	}
	.content-custom-content-item {
	  width: 30%;
	  margin-right: 10upx;
	  display: inline-block;
	  vertical-align: top;
	  border: 1px solid #ddd;
	  border-radius: 5upx;
	  
	}
	.img {
	  display: inline-block;
		width: 100%;
	}
	.img  img {
	    width: 100%;
	    height: 100%;
	    border-radius: 6upx;
	}
	.content-custom-content-text{
		padding-left: 5upx;
	}
	.content-custom-content-item-title {
	  display: block; // 让字体换行
	  width: 100%;
	  overflow: hidden;
	  white-space: nowrap;
	  text-overflow: ellipsis;
	  font-size: 30upx;
	  line-height: 40upx;
	  font-weight: bold;
	}

</style>
